package com.lanmon.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "com_menu")
public class ComMenu {
	private Integer menuid;
	private String menuname;
	private String requesturl;
	private ComMenu parentMenu;
	private String iconcls;
	private String expanded;
	private String leaf;
	private Integer sortno;
	private String menutype;
	private String remark;
	
	@GenericGenerator(name = "generator", strategy = "identity")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "menuid", unique = true, nullable = false)
	public Integer getMenuid() {
		return menuid;
	}
	
	public void setMenuid(Integer menuid) {
		this.menuid = menuid;
	}
	
	@Column(name = "menuname", nullable = false, length = 100)
	public String getMenuname() {
		return menuname;
	}
	
	public void setMenuname(String menuname) {
		this.menuname = menuname;
	}
	
	@Column(name = "requesturl", nullable = false, length = 1000)
	public String getRequesturl() {
		return requesturl;
	}
	
	public void setRequesturl(String requesturl) {
		this.requesturl = requesturl;
	}
	
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parentid")
	public ComMenu getParentMenu() {
		return parentMenu;
	}
	
	public void setParentMenu(ComMenu parentMenu) {
		this.parentMenu = parentMenu;
	}
	
	@Column(name = "iconcls", length = 100)
	public String getIconcls() {
		return iconcls;
	}
	
	public void setIconcls(String iconcls) {
		this.iconcls = iconcls;
	}
	
	@Column(name = "expanded", length = 2)
	public String getExpanded() {
		return expanded;
	}
	
	public void setExpanded(String expanded) {
		this.expanded = expanded;
	}
	
	@Column(name = "leaf", length = 2)
	public String getLeaf() {
		return leaf;
	}
	
	public void setLeaf(String leaf) {
		this.leaf = leaf;
	}
	
	@Column(name = "sortno")
	public Integer getSortno() {
		return sortno;
	}
	
	public void setSortno(Integer sortno) {
		this.sortno = sortno;
	}
	
	@Column(name = "menutype", length = 2)
	public String getMenutype() {
		return menutype;
	}
	
	public void setMenutype(String menutype) {
		this.menutype = menutype;
	}
	
	@Column(name = "remark", length = 500)
	public String getRemark() {
		return remark;
	}
	
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
}
